using System;
using Microsoft.SPOT;

namespace MLRobotic.IA.Goals
{
    public class TurnTo : Goal
    {
        private int _angle;

        public TurnTo(int angle)
            : base()
        {
            _angle = angle;
        }
    
        public override void Process()
        {
            if (State == GoalSate.Todo)
            {
                State = GoalSate.Doing;
                Com.TurnTo(_angle);
            }
            else if (State == GoalSate.Doing)
            {
                if (Robot.NotifyFinDeplace)
                {
                    State = GoalSate.Done;
                }
            }
        }
    }
}
